package databeans;

public class Fund implements Comparable<Fund>  {
    private int fundID = -1;
    private String name = null;
    private String symbol = null;
    
    
    public Fund(){
        fundID = -1;
        name = null;
        symbol = null;
        
    }

    public Fund(int fundID, String name, String symbol){
        this.fundID = fundID;
        this.name = name;
        this.symbol = symbol;
    }
    
    public int compareTo(Fund f) {
        // order by id then symbol
        int c = symbol.compareTo(String.valueOf(f.fundID));
        if (c != 0){
            return c;
        }
        c = symbol.compareTo(f.symbol);
        if (c != 0){
            return c;
        }
        /*
        c = name.compareTo(f.name);

        */
        return name.compareTo(f.name);
    }

    public int getFundID() {
        return fundID;
    }

    public void setFundID(int fundID) {
        this.fundID = fundID;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSymbol() {
        return symbol.toUpperCase();
    }

    public void setSymbol(String symbol) {
        this.symbol = symbol.toUpperCase();
    }
    
    

}
